package com.weasel.weixin.commons.message.builder.initiative;

import com.weasel.weixin.commons.message.bean.initiative.TextCustomInitiativeMessage;

/**
 * Created by Dylan on 2015/10/19.
 */
public class TextCustomInitiativeMessageBuilder extends AbstractCustomInitiativeMessageBuilder<TextCustomInitiativeMessageBuilder,TextCustomInitiativeMessage> {


    public TextCustomInitiativeMessageBuilder() {
        super(new TextCustomInitiativeMessage());
    }

    public TextCustomInitiativeMessageBuilder content(String content){

        getText().setContent(content);
        return this;
    }

    private TextCustomInitiativeMessage.Text getText(){
        TextCustomInitiativeMessage.Text text = ((TextCustomInitiativeMessage) message).getText();
        if(null == text){
            text = new TextCustomInitiativeMessage.Text();
            ((TextCustomInitiativeMessage) message).setText(text);
        }
        return text;
    }

}
